package com.kuang.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kuang.entity.Gift;
import com.kuang.mapper.GiftMapper;
import com.kuang.service.GiftService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 类说明
 *
 * @author liaosheng
 * @date 2021-04-29
 */
@Service
public class GiftServiceImpl implements GiftService {

    @Autowired
    private GiftMapper giftMapper;

    @Override
    public Page<Gift> page() {
        Page<Gift> page = new Page<>(2, 5);
        Page<Gift> giftPage = giftMapper.selectPage(page, null);
        return giftPage;
    }

    @Override
    public void add(Gift gift) {

       giftMapper.insert(gift);
    }

    @Override
    public void update(Gift gift) {

       giftMapper.updateById(gift);
    }
}
